package com.foreknow.elmboot.service.impl;


import com.foreknow.elmboot.mapper.DeliveryAddressMapper;
import com.foreknow.elmboot.po.DeliveryAddress;
import com.foreknow.elmboot.service.DeliveryAddressService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class DeliveryAddressServiceImpl implements DeliveryAddressService {
    @Autowired
    private DeliveryAddressMapper deliveryAddressMapper;

    @Override
    public List<DeliveryAddress> listDeliveryAddressByUserIdService(String userId) {
        return deliveryAddressMapper.listDeliveryAddressByUserIdDao(userId);
    }

    @Override
    public DeliveryAddress getDeliveryAddressByIdService(Integer daId) {
        return deliveryAddressMapper.getDeliveryAddressByIdDao(daId);
    }

    @Override
    public int saveDeliveryAddressService(DeliveryAddress deliveryAddress) {
        return deliveryAddressMapper.saveDeliveryAddressDao(deliveryAddress);
    }

    @Override
    public int updateDeliveryAddressService(DeliveryAddress deliveryAddress) {
        return deliveryAddressMapper.updateDeliveryAddressDao(deliveryAddress);
    }

    @Override
    public int removeDeliveryAddressService(Integer daId) {
        return deliveryAddressMapper.removeDeliveryAddressDao(daId);
    }
}
